#ifndef __SENWORDTRIE__
#define __SENWORDTRIE__

#include <list>
using namespace std;

const int num_chars = 0xFF+1;

class SenWordTrie 
{
public:
	SenWordTrie();

	virtual ~SenWordTrie();

	int trie_search(const char* word, unsigned int uiSearchLen, char ** szRetSenWord) const;

	int insert(const char* word);

	int querySenWord(const char * srcContent, char ** szRetSenWord) const;

    int replaceSenWord(char * srcContent);

    int replaceSenWord2(char * srcContent);

	int remove(const char* word);

	void dump();

protected:
	SenWordTrie(SenWordTrie& tr);

	struct SenWordTrie_node
	{    
		char* senWordData;
		SenWordTrie_node* branch[num_chars];
		bool is_sensitive_word;
		unsigned int level;

		SenWordTrie_node();
		~SenWordTrie_node();
	};

public:
    //debug info
    int m_memorySize;
    int m_nodeCounts;
     
private:
	SenWordTrie_node* m_root;
	list<SenWordTrie_node*> m_lNodes;
};


#endif 
